From bdb325cb4ef1761417024980dbf7b6a70a3d996f Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 2 Feb 2011 10:42:17 +0000 Subject: [PATCH] Fixup some trailing newlines Fixup indentation of a few methods Add a couple of return type hints --- includes/filerepo/File.php | 17 ++++++++------- includes/upload/UploadBase.php | 2 +- includes/upload/UploadFromStash.php | 34 ++++++++++++++--------------- includes/upload/UploadFromUrl.php | 8 ++++++- includes/upload/UploadStash.php | 6 ----- 5 files changed, 34 insertions(+), 33 deletions(-) diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index bbcb4f97e3..f5ba3a4533 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -157,6 +157,7 @@ abstract class File { /** * Return the associated title object + * @return Title */ public function getTitle() { return $this->title; } @@ -269,14 +270,14 @@ abstract class File { /** * Return true if the file is vectorized */ - public function isVectorized() { - $handler = $this->getHandler(); - if ( $handler ) { - return $handler->isVectorized( $this ); - } else { - return false; - } - } + public function isVectorized() { + $handler = $this->getHandler(); + if ( $handler ) { + return $handler->isVectorized( $this ); + } else { + return false; + } + } /** diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 29fe73b215..ea065a7fa4 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -1102,7 +1102,7 @@ abstract class UploadBase { * - File exists with normalized extension * - The file looks like a thumbnail and the original exists * - * @param $file The File object to check + * @param $file File The File object to check * @return mixed False if the file does not exists, else an array */ public static function getExistsWarning( $file ) { diff --git a/includes/upload/UploadFromStash.php b/includes/upload/UploadFromStash.php index 7f0f92ef14..804db6b4ed 100644 --- a/includes/upload/UploadFromStash.php +++ b/includes/upload/UploadFromStash.php @@ -25,24 +25,24 @@ class UploadFromStash extends UploadBase { } public function initialize( $name, $sessionKey, $sessionData ) { - /** - * Confirming a temporarily stashed upload. - * We don't want path names to be forged, so we keep - * them in the session on the server and just give - * an opaque key to the user agent. - */ + /** + * Confirming a temporarily stashed upload. + * We don't want path names to be forged, so we keep + * them in the session on the server and just give + * an opaque key to the user agent. + */ - $this->initializePathInfo( $name, - $this->getRealPath ( $sessionData['mTempPath'] ), - $sessionData['mFileSize'], - false - ); - - $this->mSessionKey = $sessionKey; - $this->mVirtualTempPath = $sessionData['mTempPath']; - $this->mFileProps = $sessionData['mFileProps']; - $this->mSourceType = isset( $sessionData['mSourceType'] ) ? - $sessionData['mSourceType'] : null; + $this->initializePathInfo( $name, + $this->getRealPath ( $sessionData['mTempPath'] ), + $sessionData['mFileSize'], + false + ); + + $this->mSessionKey = $sessionKey; + $this->mVirtualTempPath = $sessionData['mTempPath']; + $this->mFileProps = $sessionData['mFileProps']; + $this->mSourceType = isset( $sessionData['mSourceType'] ) ? + $sessionData['mSourceType'] : null; } public function initializeFromRequest( &$request ) { diff --git a/includes/upload/UploadFromUrl.php b/includes/upload/UploadFromUrl.php index 8e4ffbf36a..7acb051087 100644 --- a/includes/upload/UploadFromUrl.php +++ b/includes/upload/UploadFromUrl.php @@ -187,7 +187,13 @@ class UploadFromUrl extends UploadBase { return parent::performUpload( $comment, $pageText, $watch, $user ); } - + /** + * @param $comment + * @param $pageText + * @param $watch + * @param $user User + * @return + */ protected function insertJob( $comment, $pageText, $watch, $user ) { $sessionKey = $this->stashSession(); $job = new UploadFromUrlJob( $this->getTitle(), array( diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index 27e0ec1bb7..ece13eacf8 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -186,14 +186,12 @@ class UploadStash { return true; } - /** * List all files in the stash. */ public function listFiles() { return array_keys( $_SESSION[UploadBase::SESSION_KEYNAME] ); } - /** * Find or guess extension -- ensuring that our extension matches our mime type. @@ -269,8 +267,6 @@ class UploadStashFile extends UnregisteredLocalFile { throw new UploadStashFileNotFoundException( 'cannot find path, or not a plain file' ); } - - parent::__construct( false, $repo, $path, false ); $this->name = basename( $this->path ); @@ -346,7 +342,6 @@ class UploadStashFile extends UnregisteredLocalFile { return SpecialPage::getTitleFor( 'UploadStash', $subPage )->getLocalURL(); } - /** * Get a URL to access the thumbnail * This is required because the model of how files work requires that @@ -397,7 +392,6 @@ class UploadStashFile extends UnregisteredLocalFile { return $this->getUrl(); } - /** * Getter for session key (the session-unique id by which this file's location & metadata is stored in the session) * -- 2.20.1